# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Docs.V1.Model.ParagraphStyle do
  @moduledoc """
  Styles that apply to a whole paragraph. Inherited paragraph styles are represented as unset fields in this message. A paragraph style's parent depends on where the paragraph style is defined: * The ParagraphStyle on a Paragraph inherits from the paragraph's corresponding named style type. * The ParagraphStyle on a named style inherits from the normal text named style. * The ParagraphStyle of the normal text named style inherits from the default paragraph style in the Docs editor. * The ParagraphStyle on a Paragraph element that's contained in a table may inherit its paragraph style from the table style. If the paragraph style does not inherit from a parent, unsetting fields will revert the style to a value matching the defaults in the Docs editor.

  ## Attributes

  *   `alignment` (*type:* `String.t`, *default:* `nil`) - The text alignment for this paragraph.
  *   `avoidWidowAndOrphan` (*type:* `boolean()`, *default:* `nil`) - Whether to avoid widows and orphans for the paragraph. If unset, the value is inherited from the parent.
  *   `borderBetween` (*type:* `GoogleApi.Docs.V1.Model.ParagraphBorder.t`, *default:* `nil`) - The border between this paragraph and the next and previous paragraphs. If unset, the value is inherited from the parent. The between border is rendered when the adjacent paragraph has the same border and indent properties. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
  *   `borderBottom` (*type:* `GoogleApi.Docs.V1.Model.ParagraphBorder.t`, *default:* `nil`) - The border at the bottom of this paragraph. If unset, the value is inherited from the parent. The bottom border is rendered when the paragraph below has different border and indent properties. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
  *   `borderLeft` (*type:* `GoogleApi.Docs.V1.Model.ParagraphBorder.t`, *default:* `nil`) - The border to the left of this paragraph. If unset, the value is inherited from the parent. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
  *   `borderRight` (*type:* `GoogleApi.Docs.V1.Model.ParagraphBorder.t`, *default:* `nil`) - The border to the right of this paragraph. If unset, the value is inherited from the parent. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
  *   `borderTop` (*type:* `GoogleApi.Docs.V1.Model.ParagraphBorder.t`, *default:* `nil`) - The border at the top of this paragraph. If unset, the value is inherited from the parent. The top border is rendered when the paragraph above has different border and indent properties. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
  *   `direction` (*type:* `String.t`, *default:* `nil`) - The text direction of this paragraph. If unset, the value defaults to LEFT_TO_RIGHT since paragraph direction is not inherited.
  *   `headingId` (*type:* `String.t`, *default:* `nil`) - The heading ID of the paragraph. If empty, then this paragraph is not a heading. This property is read-only.
  *   `indentEnd` (*type:* `GoogleApi.Docs.V1.Model.Dimension.t`, *default:* `nil`) - The amount of indentation for the paragraph on the side that corresponds to the end of the text, based on the current paragraph direction. If unset, the value is inherited from the parent.
  *   `indentFirstLine` (*type:* `GoogleApi.Docs.V1.Model.Dimension.t`, *default:* `nil`) - The amount of indentation for the first line of the paragraph. If unset, the value is inherited from the parent.
  *   `indentStart` (*type:* `GoogleApi.Docs.V1.Model.Dimension.t`, *default:* `nil`) - The amount of indentation for the paragraph on the side that corresponds to the start of the text, based on the current paragraph direction. If unset, the value is inherited from the parent.
  *   `keepLinesTogether` (*type:* `boolean()`, *default:* `nil`) - Whether all lines of the paragraph should be laid out on the same page or column if possible. If unset, the value is inherited from the parent.
  *   `keepWithNext` (*type:* `boolean()`, *default:* `nil`) - Whether at least a part of this paragraph should be laid out on the same page or column as the next paragraph if possible. If unset, the value is inherited from the parent.
  *   `lineSpacing` (*type:* `number()`, *default:* `nil`) - The amount of space between lines, as a percentage of normal, where normal is represented as 100.0. If unset, the value is inherited from the parent.
  *   `namedStyleType` (*type:* `String.t`, *default:* `nil`) - The named style type of the paragraph. Since updating the named style type affects other properties within ParagraphStyle, the named style type is applied before the other properties are updated.
  *   `pageBreakBefore` (*type:* `boolean()`, *default:* `nil`) - Whether the current paragraph should always start at the beginning of a page. If unset, the value is inherited from the parent. Attempting to update page_break_before for paragraphs in unsupported regions, including Table, Header, Footer and Footnote, can result in an invalid document state that returns a 400 bad request error.
  *   `shading` (*type:* `GoogleApi.Docs.V1.Model.Shading.t`, *default:* `nil`) - The shading of the paragraph. If unset, the value is inherited from the parent.
  *   `spaceAbove` (*type:* `GoogleApi.Docs.V1.Model.Dimension.t`, *default:* `nil`) - The amount of extra space above the paragraph. If unset, the value is inherited from the parent.
  *   `spaceBelow` (*type:* `GoogleApi.Docs.V1.Model.Dimension.t`, *default:* `nil`) - The amount of extra space below the paragraph. If unset, the value is inherited from the parent.
  *   `spacingMode` (*type:* `String.t`, *default:* `nil`) - The spacing mode for the paragraph.
  *   `tabStops` (*type:* `list(GoogleApi.Docs.V1.Model.TabStop.t)`, *default:* `nil`) - A list of the tab stops for this paragraph. The list of tab stops is not inherited. This property is read-only.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :alignment => String.t() | nil,
          :avoidWidowAndOrphan => boolean() | nil,
          :borderBetween => GoogleApi.Docs.V1.Model.ParagraphBorder.t() | nil,
          :borderBottom => GoogleApi.Docs.V1.Model.ParagraphBorder.t() | nil,
          :borderLeft => GoogleApi.Docs.V1.Model.ParagraphBorder.t() | nil,
          :borderRight => GoogleApi.Docs.V1.Model.ParagraphBorder.t() | nil,
          :borderTop => GoogleApi.Docs.V1.Model.ParagraphBorder.t() | nil,
          :direction => String.t() | nil,
          :headingId => String.t() | nil,
          :indentEnd => GoogleApi.Docs.V1.Model.Dimension.t() | nil,
          :indentFirstLine => GoogleApi.Docs.V1.Model.Dimension.t() | nil,
          :indentStart => GoogleApi.Docs.V1.Model.Dimension.t() | nil,
          :keepLinesTogether => boolean() | nil,
          :keepWithNext => boolean() | nil,
          :lineSpacing => number() | nil,
          :namedStyleType => String.t() | nil,
          :pageBreakBefore => boolean() | nil,
          :shading => GoogleApi.Docs.V1.Model.Shading.t() | nil,
          :spaceAbove => GoogleApi.Docs.V1.Model.Dimension.t() | nil,
          :spaceBelow => GoogleApi.Docs.V1.Model.Dimension.t() | nil,
          :spacingMode => String.t() | nil,
          :tabStops => list(GoogleApi.Docs.V1.Model.TabStop.t()) | nil
        }

  field(:alignment)
  field(:avoidWidowAndOrphan)
  field(:borderBetween, as: GoogleApi.Docs.V1.Model.ParagraphBorder)
  field(:borderBottom, as: GoogleApi.Docs.V1.Model.ParagraphBorder)
  field(:borderLeft, as: GoogleApi.Docs.V1.Model.ParagraphBorder)
  field(:borderRight, as: GoogleApi.Docs.V1.Model.ParagraphBorder)
  field(:borderTop, as: GoogleApi.Docs.V1.Model.ParagraphBorder)
  field(:direction)
  field(:headingId)
  field(:indentEnd, as: GoogleApi.Docs.V1.Model.Dimension)
  field(:indentFirstLine, as: GoogleApi.Docs.V1.Model.Dimension)
  field(:indentStart, as: GoogleApi.Docs.V1.Model.Dimension)
  field(:keepLinesTogether)
  field(:keepWithNext)
  field(:lineSpacing)
  field(:namedStyleType)
  field(:pageBreakBefore)
  field(:shading, as: GoogleApi.Docs.V1.Model.Shading)
  field(:spaceAbove, as: GoogleApi.Docs.V1.Model.Dimension)
  field(:spaceBelow, as: GoogleApi.Docs.V1.Model.Dimension)
  field(:spacingMode)
  field(:tabStops, as: GoogleApi.Docs.V1.Model.TabStop, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Docs.V1.Model.ParagraphStyle do
  def decode(value, options) do
    GoogleApi.Docs.V1.Model.ParagraphStyle.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Docs.V1.Model.ParagraphStyle do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
